<template>
    <script id="editor" type="text/plain"></script>
</template>
<script>
    import '../../../static/ueditor/ueditor.config.js'  //根据自己文件的路径接入
    import 'ueditor/example/public/ueditor/ueditor.all'
    import 'ueditor/example/public/ueditor/ueditor.parse'
    export default {
        name: "UEditor",
        props: {
            id: {
                type: String
            },
            config: {
                type: Object
            }
        },
        data() {
            return {
                editor: null
            }
        },
        mounted() {
            //初始化UE
            const _this = this;
            this.editor = UE.getEditor('editor',this.config);
        },
        destroyed() {
            this.editor.destroy();
        },
        methods:{
            getUEContent: function(){
                return this.editor.getContent();
            },
            setUEcontent:function (value) {
                return this.editor.setContent(value);
            }
        }
    }
</script>
<style type="text/css">
    #editor{z-index: 0;}
    .ivu-form-item {
        margin-bottom:20px;
        vertical-align: top;
        zoom: 1;
    }
</style>
